package xgenerator.dao.impl;

import java.util.Properties;
import java.util.Vector;

import xgenerator.dao.DataSourceConfigDao;
import xgenerator.jdbc.JdbcUtils;

public class DataSourceConfigDaoAccessImpl implements DataSourceConfigDao {

	/**
	 * <p>
	 * Title：根据数据源名称，获取数据库类型
	 * </p>
	 * @author <a href="mailto:shushanlee@msn.com">liss</a>
	 * @param dataSourceName
	 * @return
	 * @see xgenerator.dao.DataSourceConfigDao#getDbType(java.lang.String)
	 */
	public String getDbType(String dataSourceName) {
		String driverClassName = "";
		
		return JdbcUtils.analysisDbType(driverClassName);
	}
	
	/**
	 * <p>
	 * Title：获取配置的所有数据源列表
	 * </p>
	 * @author <a href="mailto:shushanlee@msn.com">liss</a>
	 * @return
	 * @see xgenerator.dao.DataSourceConfigDao#findAllDataSourceNames()
	 */
	public Vector<String> findAllDataSourceNames() {
		Vector<String> dataSourceNames = new Vector<String>();
		
		return dataSourceNames;
	}
	
	/**
	 * <p>
	 * Title：根据数据源名称，获取数据源配置信息
	 * </p>
	 * @author <a href="mailto:shushanlee@msn.com">liss</a>
	 * @param datasourceName
	 * @return
	 * @see xgenerator.dao.DataSourceConfigDao#findByName(java.lang.String)
	 */
	public Properties findByName(String dataSourceName) {
		Properties properties = new Properties();
		
		String driverClassName = "";
		String url = "";
		String user = "";
		String password = "";

		properties.setProperty("name", dataSourceName);
		properties.setProperty("jdbc.driverClassName", driverClassName);
		properties.setProperty("jdbc.url", url);
		properties.setProperty("jdbc.user", user);
		properties.setProperty("jdbc.password", password);
		
		return properties;
	}

	/**
	 * <p>
	 * Title：添加数据源配置信息
	 * </p>
	 * @author <a href="mailto:shushanlee@msn.com">liss</a>
	 * @param properties
	 * @return
	 * @see xgenerator.dao.DataSourceConfigDao#insert(java.util.Properties)
	 */
	public long insert(Properties properties) {
		return 0;
	}

	/**
	 * <p>
	 * Title：更新数据源配置信息
	 * </p>
	 * @author <a href="mailto:shushanlee@msn.com">liss</a>
	 * @param properties
	 * @see xgenerator.dao.DataSourceConfigDao#update(java.util.Properties)
	 */
	public void update(Properties properties) {

	}
	
	/**
	 * <p>
	 * Title：删除数据源配置信息
	 * </p>
	 * @author <a href="mailto:shushanlee@msn.com">liss</a>
	 * @param dataSourceName
	 * @see xgenerator.dao.DataSourceConfigDao#delete(java.lang.String)
	 */
	public void delete(String dataSourceName) {
		
	}

}
